<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="UTF-8">
		<title>我的申请</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="${resource }/css/bootstrap.css" />
	</head>
	<body>
		<div class="row wrapper border-bottom white-bg page-heading">
			<div class="col-sm-4">
				<h2>我的流程</h2>
				<ol class="breadcrumb">
					<li>
						<a href="index.html">主页</a>
					</li>
					<li>
						<strong>我的申请</strong>
					</li>
				</ol>
			</div>
		</div>
		<div class="row wrapper border-bottom white-bg page-heading">
			<div class="col-md-12">
				<!-- 流程列表--bootstrap高级表格使用 -->
				<div class="panel panel-default">
					<div class="panel-heading">
						流程列表
					</div>
					<div class="panel-body">
						<!--table-responsive响应式表格，会自动添加滚动条-->
						<div class="table-responsive">
							<table class="table">
								<thead>
									<tr class="gradeX">
										<th>流水号</th>
										<th>流程名</th>
										<th>当前步骤</th>
										<th>步骤状态</th>
										<th>日期</th>
									</tr>
								</thead>
								<tbody>
								<c:forEach items="${list}" var="list">
									<tr class="odd " onclick="flow_detail(1)">
										<td>${list.id}</td>
										<td>${list.workflow.workflowName}</td>
										<td>${list.step.stepName}</td>
										<c:choose>
											<c:when test="${list.isVerify==0}">
												<td>待审核</td>
											</c:when>
											<c:when test="${list.isVerify==1}">
												<td>审核通过</td>
											</c:when>
											<c:otherwise>
												<td>审核未通过</td>
											</c:otherwise>
										</c:choose>
										<td>${list.date}</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
						</div>

						<!--分页显示-->
						<div class="row">
							<div class="col-md-6">
								<div class="pagination" style="margin: 0px;" role="alert" aria-live="polite" aria-relevant="all">显示 1 到 ${detail.getPages()} 页 记录数${detail.getTotal()}</div>
							</div>
							<!-- 动态分页 -->
							<div class="row">
							<div id="page" class="col-md-6" style="text-align: right;float:right;" ></div>
							</div>
						</div>
						<!--分页显示-->
					</div>
				</div>
			</div>
		</div>
		<!--表格结束 -->
		<!-- Mainly scripts -->
		<script src="${resource }/js/jquery-2.1.1.min.js"></script>
		<script src="${resource }/js/bootstrap.min.js?v=3.4.0"></script>
		<!-- 分页插件，依赖于jquery位于jquery之后 -->
		<script src="${resource }/js/page.js"></script>
	</body>
	<script >
	$(function(){
			/* 分页插件使用 */
			$("#page").page({/* #page是分页条div的id，调用分页插件page.js中封装的page函数*/
				pageNo:${detail.getPageNo()},/*向page函数传  当前页数，当前页数从controller获取*/
				totalPage:${detail.getPages()},/*向page函数传  总页数，总页数从controller获取*/
				url:"${detail.getUrl()}"/*向page函数传  处理分页的controller地址*/
			});
		}) 
	</script>
</html>